import React, { Component } from 'react';
import dynamic from 'dva/dynamic';
import { Route } from 'dva/router';

export default function evaluateRoute(app) {

    const EvaluateList = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "evaluateListModel" */'../models/evaluate/evaluateListModel'),
                import(/* webpackChunkName: "evaluateListModel" */'../models/goodsDetail/goodsDetailModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "evaluatelist" */'../routes/evaluate/evaluateList'),
    });
    const EvaluateDetail = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "EvaluateDetail" */'../models/evaluate/evaluateDetailModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "EvaluateDetail" */'../routes/evaluate/evaluateDetail'),
    });


    return (
        [
            <Route key="/evaluateList" exact strict path="/evaluateList/:goodsId/:specId" component={ EvaluateList }/>,
            <Route key="/evaluateDetail" exact strict path="/evaluateDetail/:gevalId" component={ EvaluateDetail }/>
        ]
    );
}
